package top.kaoshanji.p1ch01c;

import top.kaoshanji.p1ch01c.exception.ExceptionA;
import top.kaoshanji.p1ch01c.exception.ExceptionB;
import top.kaoshanji.p1ch01c.exception.ExceptionC;

/**
 * 代码清单 p1ch01c-05：在catch子句中指定多种异常(1.4.4节)
 * 捕获3个异常两种类型，每种类型的处理逻辑不同
 * author kaoshanji
 * ^_^
 * create time 2024/12/22 19:57
 */
public class ExceptionHandler {

    public void handle() {

        ExceptionThrower thrower = new ExceptionThrower();
        try {
            thrower.manyExceptions();
        } catch (ExceptionA | ExceptionB ab) {
            System.out.println(ab.getClass());
        } catch (ExceptionC c) {}

    }


}
